//toggle GOODS NAV
function showNav(type) {
    if (!type) {
        return;
    }
    var nav = $api.dom('#u-nav .active');
    $api.removeCls(nav, 'active');
    var thisNav = $api.dom('#u-nav .' + type);
    $api.addCls(thisNav, 'active');
}
function openFrame() {
    var width = api.winWidth;
    var header = $api.byId('account-wrap'); 	 
    
    var headerPos = $api.offset(header);
    var height = api.winHeight - headerPos.h;
    
        api.openFrame({
	    name: 'rechangeDetail',
	    url: './rechangeDetail.html',
	    rect: {
	        x: 0,
	        y: headerPos.h,
	        w: width,
	        h: height
	    },
	   
	    bounces: true,
	    customRefreshHeader: 'UIPullRefresh'
	 
});
   }
 
apiready = function(){
var systemType = api.systemType;

	
headerstatus();
	var user = $api.getStorage('user')
	
    var uid = user.uid;
    
    if(systemType=='ios'){
						api.ajax({
					    url:'http://wap.jqmao.cn/hide'
				    },function(ret,err){
				    	//coding...
				    	//alert(ret.value)
				    	if(ret.value=='1'){
				    	//alert(ret.value)
				    	 	var money = null;
				    	 	//alert(money)
				    	 	var content = $api.byId('money-content');
						    var tpl = $api.byId('money-template').text;
						    var tempFn = doT.template(tpl);
						    $api.html(content, tempFn(money));
						   	openFrame()
				    	}else{
				    		var money = user.money;
				    		//alert(money)
				    	 	var content = $api.byId('money-content');
						    var tpl = $api.byId('money-template').text;
						    var tempFn = doT.template(tpl);
						    $api.html(content, tempFn(money));
						   	openFrame()
				    	}
				    });
				}else{
							var money = user.money;
							//alert(money)
				    	 	var content = $api.byId('money-content');
						    var tpl = $api.byId('money-template').text;
						    var tempFn = doT.template(tpl);
						    $api.html(content, tempFn(money));
						   	openFrame()
				}
	
    
    

}
    